#include<stdio.h>
int n;
int main(){
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	scanf("%d",&n);
	int frt[n+5];
	for(int i=1;i<=n;i++){
		scanf("%d",frt+i);
		frt[i]++;
	}
	int cnt=n;
	do{
		char b=(frt[1]==1?2:1);
		for(int i=1;i<=n;i++){
			if(frt[i]!=0&&b!=frt[i]){
				b=frt[i],frt[i]=0,cnt--;
				printf("%d ",i);
			}
		}
		putchar('\r');
	}while(cnt>0);
}
